package uni.UNIBEE7B8D.Adapter;




import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by sdtz on 2017/10/17.
 */
public class NewsFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private List<String> title;

    public NewsFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    public NewsFragmentAdapter(FragmentManager fm, List<Fragment> fragments, List<String> title) {
        super(fm);
        this.fragments = fragments;
        this.title = title;
    }




    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title.get(position);
    }

}
